package com.ossjk.core.vo;

import java.io.Serializable;

import io.swagger.annotations.ApiModelProperty;

public class ResponseBean<T> implements Serializable {

    @ApiModelProperty(value = "操作码")
	private Integer code;
    @ApiModelProperty(value = "响应信息")
	private String msg;
    @ApiModelProperty(value = "数据")
	private T data;
	
	

	public ResponseBean() {
		 
	}

	public ResponseBean(Integer code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public ResponseBean(Integer code, String msg, T data) {
		this.code = code;
		this.msg = msg;
		this.data = data;
	}

	private ResponseBean(Builder<T> builder) {
		this.code = builder.code;
		this.msg = builder.msg;
		this.data = builder.data;
	}

	public static class Builder<T> {
		private Integer code;
		private String msg;
		private T data;

		public Builder code(Integer code) {
			this.code = code;
			return this;
		}

		public Builder msg(String msg) {
			this.msg = msg;
			return this;
		}

		public Builder data(T data) {
			this.data = data;
			return this;
		}

		public ResponseBean build() {
			return new ResponseBean(this);
		}
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

	@Override
	public String toString() {
		return "ResponseBean [code=" + code + ", msg=" + msg + ", data=" + data + "]";
	}

}
